package com.inst.custom_viewdemo.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.inst.custom_viewdemo.R;
import com.inst.custom_viewdemo.bean.PieData;
import com.inst.custom_viewdemo.view.Canvas2View;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

public class Canvas2Activity extends AppCompatActivity {

    @BindView(R.id.canvas2_view)
    Canvas2View mCanvas2View;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //初始化调用第一个函数
        //        Canvas1View canvas1View = new Canvas1View(this);
        //        setContentView(canvas1View);
        //初始化调用第二个函数---
        setContentView(R.layout.activity_canvas2);
        ButterKnife.bind(this);

        ArrayList<PieData> datas = new ArrayList<>();
        PieData pieData = new PieData("sloop", 60);
        PieData pieData2 = new PieData("sloop", 30);
        PieData pieData3 = new PieData("sloop", 40);
        PieData pieData4 = new PieData("sloop", 20);
        PieData pieData5 = new PieData("sloop", 20);
        datas.add(pieData);
        datas.add(pieData2);
        datas.add(pieData3);
        datas.add(pieData4);
        datas.add(pieData5);
        mCanvas2View.setData(datas);
    }


}
